<?php
require_once "config.php";
//验证分享参数
function checkWeixinShareParamet($srcopenid = '', $campaignID = '', $token, $unixtime)
{
	$key = "hugjmk5AB24giest5weixinkongmingCC@#fKM";
	$checkToken = md5($srcopenid . $key . $campaignID . $unixtime);
	if ($token != $checkToken)
	{
		$result = false;
	} else
	{
		$result = true;
	}
	return $result;
}
if (isset($_GET['srcopenid']) && $_GET['srcopenid'] != '' && isset($_GET['campaignID']) && $_GET['campaignID'] != '' && isset($_GET['token']) && $_GET['token'] != '' && isset($_GET['unixtime']) && $_GET['unixtime'] != '')
{
	if(checkWeixinShareParamet($_GET['srcopenid'], $_GET['campaignID'], $_GET['token'], $_GET['unixtime']))
	{
		if (!session_id())
		{
			session_start();
		}
		$_SESSION['srcopenid'] = $_GET['srcopenid'];
		$_SESSION['campaignID'] = $_GET['campaignID'];
		$_SESSION['srcopenidStartTime'] = time();
	}
}

?>